package com.github.netty.springboot;

public class RestrictedClassLoader extends ClassLoader {
    @Override
    protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
    	if (name.startsWith("java.rmi") || 
                name.startsWith("javax.naming") || 
                name.startsWith("com.sun.jndi") || 
                name.startsWith("org.apache.naming") ||
                name.startsWith("org.apache.cxf")) {
                throw new ClassNotFoundException("Loading of this class is restricted: " + name);
            }
        return super.loadClass(name, resolve);
    }
}